<?php 
	include_once 'classes/Campaign.php';
	include_once 'classes/CampaignList.php';
	include_once 'classes/Product.php';
	include_once 'classes/controls/LoginForm.php';
	include_once 'classes/Basket.php';
	
	session_start();
	
	if (isset($_GET['ID'])){
	$ID = $_GET['ID'];
	}
	else{
		// öylesine
		$ID = "prc-bot-001";
	}
	
	$product = new Product();
	$product->product_id = $ID;
	$product->setProduct($ID);
	$cPage = "product";
	
	if(isset($_GET["add"])){
		if(isset($_SESSION["basketArray"])){
		$basketArray = $_SESSION["basketArray"];
		}
		else{
			$basketArray = array();
		}
		$basketArray[$ID] = $ID;
		$_SESSION["basketArray"] = $basketArray;
	}
	
	$pCamp = new Campaign();
	$pCamp->setCampaign($product->brand_id);
?>
<?php include_once 'header.php';?>


<div id="static_bar">
  <div id="static_bar_logo">
  <table border="0" cellspacing="0" cellpadding="0">
    <tbody><tr>
      <td valign="middle" style="padding-right:10px;"><a href="<?php echo "/infophp/kampanya.php?brand_id=".$product->brand_id  ."&cat=".$product->cat_name ; ?>"><img src="./images/geri-don.png" style="_padding-top:600px;"></a></td>
      <td valign="middle"><?php echo $pCamp->name;?></td>
    </tr>
  </tbody></table>
  </div>
  <div id="static_bar_counter" class="campaign-counter">
    
  </div>
</div>

          <div id="content">
            
            <table class="content_layout" width="100%" border="0" cellspacing="0" cellpadding="0">
            <tbody><tr>
            
            <td class="content_layout">
              <div id="right">
                
<div id="product" class="content">
<table class="ct" border="0" cellspacing="0" cellpadding="0" width="100%">
<tbody><tr>
<td width="276" style="border-right:1px dotted #919191;">
  <div id="product-sidebar">
    <div id="product-image" align="center">
      <img src="./media/product/<?php echo $product->image;?>" width="276" height="385" style="opacity: 1; " title=""><div id="zoomTintLayer" style="display: none; "></div>
    </div>    
    </div></td>
<td>
  <div id="product-details">
    

<div style="position:relative;">
<div style="position:absolute;right:8px;">
<table>
    <tbody><tr>
      <td>
        <span>Kampanyanın bitmesine</span>
      </td>
      <td>
        <div class="campaign-counter-table-container">
          <table cellspacing="0" class="campaign-counter-table">
          <tbody>
          <?php 
              	$finish_time = $pCamp->date_finish;
	          	$d = DateTime::createFromFormat("Y-m-d H:i:s", $finish_time ." 05:00:00",new DateTimeZone("UTC"));
				$RD =  $d->format("m/d/Y H:i A");
				echo "<script language='JavaScript'>";
				echo "TargetDate='". $RD. "';";
				echo "CountActive = true;";
				echo "CountStepper = -1;";
				echo "LeadingZero = true;";
				echo "IsDetail = true;";
				echo "FinishMessage = 'Kampanya sona ermiştir.'";
				echo "</script>";
	          ?>
			
				<script language="JavaScript" src="http://localhost/infophp/includes/counter.js"></script>
				
          </tbody></table>
        </div>
      </td>
      <td>
        <span class="campaign-counter-text custom-color">kaldı.</span>
      </td>
    </tr>
    </tbody></table>
</div>
</div>

<div class="padding"><h1><?php echo $pCamp->name;?></h1>
<div id="desc"><?php echo $product->cat_name;?></div></div>

<div id="markafoniye-ozel" style="padding-top:10px;">
  <table style="width:100%;">
    <tbody><tr>
      <td style="padding-top:5px;padding-right:4px;width:30px;padding-left:27px;" valign="top"><img src="./images/sepet.png" style="_padding-top:600px;"></td>
      <td valign="top"><span id="actual_price_highlight" style="background-color:#F9F8F6;"><span id="actual_price"><?php echo $product->price;?></span> <span class="f22">TL</span>&nbsp;&nbsp;&nbsp;<strike class="f18 black"><span><?php echo $product->price * 120 / 100;?></span> TL</strike></span><br><div class="strong">arkafoni'ye özel fiyat</div></td>      
      
    </tr>
  </tbody></table>
</div>


    
  
  <div class="padding" style="height:158px;">
  
  <form method="post" id="metadata_form" action="/infophp/product.php?ID=<?php echo $product->product_id;?>&add=1"> 
      <div style="text-align:left;padding-bottom:4px;padding-top:20px;"><span style="color:#000;"><strong>Lütfen adet seçiniz</strong></span></div>
      <table width="100%" border="0" cellpadding="0" cellspacing="0">
        <tbody><tr>
          <td align="left" style="padding-top:4px;padding-bottom:20px;"><select id="id_quantity" name="quantity">
		<option value="1">&nbsp;1&nbsp;</option>
		<option value="2">&nbsp;2&nbsp;</option>
		<option value="3">&nbsp;3&nbsp;</option>
		</select></td>
        </tr>
        <tr>
          <td align="left" style="padding-bottom:17px;">Limit <span class="gray">Kişi başına <strong id="limit">3</strong> ürün</span></td>
        </tr>
      </tbody></table>
    <div style="padding-bottom:20px;"><input id="sepete_ekle" type="image" name="addbasket" alt="" src="./images/sepete-ekle.png" style="_padding-top:600px;"></div>
  </form>
  
  </div>
<!-- END FORM -->

    <div id="description" class="yui-navset">
      
        <div  style="display: block; ">
        <ul>
        <li>Ürün : <?php echo $product->name;?></li>
        <li>KOD : <?php echo $product->product_id;?></li>
        <li>STOK : <?php echo $product->stock;?></li>
        <li>Tür : <?php echo $product->short_description;?></li>
        <li>Özellikler : <br/><?php echo $product->properties?></li>
        
        </ul>
        </div>
        
    </div>
  </div>
</td>
</tr>
</tbody></table>
</div>
              </div>
            </td>
            
            
            </tr>
            </tbody></table>
            
          </div>
         
<?php include_once 'footer.php';?>
